package com.example.controller;

import com.example.service.ICircuitBreakerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @author ：liukai
 * @date ：Created in 2021/9/6 6:18 下午
 * @description：
 * @modified By：
 * @version: $
 */
@RestController
public class CircuitBreakerController {

    @Resource
    private ICircuitBreakerService iCircuitBreakerService;

    @GetMapping("/circuit/getOK/{id}")
    public String getUserOK(@PathVariable("id") int id) {
        return iCircuitBreakerService.getUserOK(id);
    }

    @GetMapping("/circuit/getTimeOut/{id}")
    public String getUserTimeOut(@PathVariable("id") int id) {
        return iCircuitBreakerService.getUserTimeOut(id);
    }

}
